public class demo9 {
    public static void main(String[] args) {
        int[] arry1  = {1,2,3,4,5,6,7,8};
        boolean flag = contains(arry1,5);
        System.out.println(flag);
    }
    public static boolean contains(int[] arry,int x){
        for (int i = 0; i < arry.length; i++) {
            if ( x == arry[i]){
                return true;
            }
        }
        return false;
    }
}
